#include #include using namespace std; void main() { //three parts to every loop // initialize test condition // test condition // do somthing and change the test condition //int i = 0; //while(i < 300) //{ // cout << i + 1 << " I will not talk in class " << endl; // i++; // //i = i + 1; // //i += 1; //} //int i = 1; //while(i <= 10) //{ // int j = 1; // while(j <= 10) // { // cout << setw(4) << i * j; // j++; // } // cout << endl; // i++; //} float time = 0; float height; float distanceTraveled = 0; float speed = 0; cout.precision(3); //the fixed flag says to use a fixed # of decimal positions cout.setf(ios_base::fixed); cout << "Initial Height of Object? "; cin >> height; while(height - distanceTraveled > 0) { speed = 9.8 * time; distanceTraveled = time * speed/2; cout << setw(8) << time; cout << setw(8) << speed; cout << setw(8) << height - distanceTraveled; cout << endl; time = time + .01; } } //void main() //{ // cout << (7 ^ 9) << endl; // // //int age; // //cout << "What is your age? "; // //cin >> age; // // //reserved word - a word that is part of the language // //inside the () should be a Boolean condition // //if(age < 1) // //{ // // cout << "You are an infant" << endl; // // cout << "You are an infant" << endl; // //} // //else if(age < 4) // //{ // // cout << "You are a toddler" << endl; // //} // //else if(age < 13) // //{ // // cout << "You are a kid" << endl; // //} // //else if(age < 20) // //{ // // cout << "You are a teenager" << endl; // //} // //else if(age < 35) // //{ // // cout << "You are a young adult" << endl; // //} // //else if(age < 65) // //{ // // cout << "You are an adult (or should be)" << endl; // //} // //else // //{ // // cout << "You are a senior" << endl; // //} // // cout << "It is over" << endl; // //}